From 3cca294d755b38ed3f7cc7264d59cf26ea0cd199 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 5 May 2014 21:28:32 +0200 Subject: [PATCH] Avoid raw sql in LocalFileDeleteBatch::doDBInserts Use Database::conditional instead of raw sql. Change-Id: Ic00146e9ec582a263b9dec117b12532fdc24789e --- includes/filerepo/file/LocalFile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 9b9f0a9ac1..4b8e590d0f 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2114,7 +2114,7 @@ class LocalFileDeleteBatch { $dbw->insertSelect( 'filearchive', 'image', array( 'fa_storage_group' => $encGroup, - 'fa_storage_key' => "CASE WHEN img_sha1='' THEN '' ELSE $concat END", + 'fa_storage_key' => $dbw->conditional( array( 'img_sha1' => '' ), $dbw->addQuotes( '' ), $concat ), 'fa_deleted_user' => $encUserId, 'fa_deleted_timestamp' => $encTimestamp, 'fa_deleted_reason' => $encReason, @@ -2146,7 +2146,7 @@ class LocalFileDeleteBatch { $dbw->insertSelect( 'filearchive', 'oldimage', array( 'fa_storage_group' => $encGroup, - 'fa_storage_key' => "CASE WHEN oi_sha1='' THEN '' ELSE $concat END", + 'fa_storage_key' => $dbw->conditional( array( 'oi_sha1' => '' ), $dbw->addQuotes( '' ), $concat ), 'fa_deleted_user' => $encUserId, 'fa_deleted_timestamp' => $encTimestamp, 'fa_deleted_reason' => $encReason, -- 2.20.1